package org.example.samplespringbootconsumer;

import com.heartunderblade.springbootstarter.annotation.RpcReference;
import com.heartunderblade.rpc.pojo.User;
import com.heartunderblade.rpc.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class controller {
    @RpcReference
    private UserService userService;
    @RequestMapping("/hello")
    public String get(){
        User user = new User("我的名字叫做heartunderblade");
        User resultUser = userService.getUser(user);
        System.out.printf(resultUser.getName());
        return resultUser.getName();
    }
}
